Skip to content

[GLUTEN-12377][CI] Stop quarantining the Delta DV row-index failures - #12829

Open
felipepessoto wants to merge 3 commits into
apache:mainfrom
felipepessoto:remove-dv-flaky-quarantine
Open

[GLUTEN-12377][CI] Stop quarantining the Delta DV row-index failures#12829
felipepessoto wants to merge 3 commits into
apache:mainfrom
felipepessoto:remove-dv-flaky-quarantine

Conversation

@felipepessoto

@felipepessoto felipepessoto commented Aug 20, 2026

Copy link
Copy Markdown
Contributor

What changes are proposed in this pull request?

The Delta Spark UT gate quarantines two native error signatures:

Delta RoaringBitmapArray row index \d+ exceeds max representable value
Delta bitmap row index cannot be negative: -\d+

Both come from the native Delta bitmap aggregator receiving a garbage row index during a MERGE that writes deletion vectors. Because the abort landed on a different *DVs*Suite test each run, matching by test name was whack-a-mole, so it was quarantined by error signature instead.

The root cause was not in the aggregator, and not in Gluten. It was a Velox scan defect: in SelectiveStructColumnReaderBase::next(), the no-child-readers branch sized the result vector to numValues but sized the synthesized fields from outputRows(), which is empty when the scan has a filter and no deletion. The row-index child therefore came back with zero rows inside a RowVector reporting N. BaseVector::wrapInDictionary() does not bounds-check indexes against the base, so downstream reads ran off the end of a zero-length buffer and returned whatever heap memory followed -- hence row indexes like 9223372036854775807, -1 and pointer-shaped values such as 0xe43315c000007f00. Most were silently accepted; occasionally one failed the aggregator's bounds check and aborted the query.

Fixed upstream in facebookincubator/velox#18536 (facebookincubator/velox#18535), merged as 1f971d3. The aggregator now receives real row indexes, so the suite can be enforced again.

This PR removes both patterns, plus the two cross-references that named them:

file change
flaky-error-patterns.txt both patterns and their rationale block removed; the generic header is kept so the mechanism stays documented
flaky-tests.txt drops the note claiming the DV bug "is handled there, which is why no *DVs*Suite MERGE entries are listed below" -- no longer true
README.md keeps the worked example, marked historical and linked to the upstream issue, since it documents how signature quarantine works

Merge dependency -- satisfied. This needed the Velox pin to contain 1f971d3. Gluten now pins dft-2026_08_21, which does, and this branch is rebased onto that bump, so the PR is ready to merge.

Fixes #12377

How was this patch tested?

The Delta Spark UT runs on this PR: .github/workflows/util/delta-spark-ut/** is in the workflow's paths: filter. With the patterns removed, a DV abort is now counted as a regression instead of being dropped.

A green run here is weak evidence on its own. The abort is intermittent -- that is precisely why it was quarantined by signature rather than by test name -- so the suite can pass on a given run whether or not the Velox fix is present. Red would be informative (the bug still fires); green would not prove much. The dependable check is simply whether the pinned Velox tag contains 1f971d3; dft-2026_08_21 does.

This PR demonstrated that caveat by accident. Its first run, before the rebase, went 8 of 8 green while building dft-2026_08_17 -- a tag that does not contain the fix. So a fully green Delta suite says nothing about whether the bug is present. The current run is against the fixed pin.

The fix itself was therefore validated separately, by making the failure deterministic instead of relying on chance. Two throwaway PRs enabled Velox's debug.validate_output_from_operators across the Delta suite, which turns the malformed vector into an immediate, reproducible error:

That A/B, not this PR's own run, is the evidence that the row indexes were corrupt and that velox#18536 fixes them.

Upstream, the fix carries two regression tests in TableScanTest, covering both ways the branch is reached: rowIndexWithFilterOnPartitionKeyOnly (static subfield filter) and rowIndexWithDynamicFilterOnPartitionKey (no filter in the plan; a join on the partition key supplies a dynamic filter at runtime). Both fail before the fix and pass after it.

Locally, compare-test-results.py was exercised against the edited file: load_patterns() returns [], and the signature matcher returns False for the old DV error -- i.e. such a failure is now enforced rather than ignored.

Was this patch authored or co-authored using generative AI tooling?

Generated-by: GitHub Copilot CLI (Claude Opus 5)

@felipepessoto
felipepessoto marked this pull request as ready for review August 21, 2026 20:47
Copilot AI lite review requested due to automatic review settings August 21, 2026 20:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes Delta Spark UT “quarantine by error signature” entries for the intermittent native Delta DV row-index failures, so those failures are enforced again now that the upstream Velox scan defect is fixed.

Changes:

  • Remove the two DV row-index error-signature regex patterns from flaky-error-patterns.txt.
  • Remove the related explanatory note from flaky-tests.txt.
  • Update the Delta Spark UT utility README to mark the worked signature-quarantine example as historical and link to the upstream Velox issue.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
.github/workflows/util/delta-spark-ut/README.md Updates documentation for signature-based quarantine and marks the DV example as historical with upstream references.
.github/workflows/util/delta-spark-ut/flaky-tests.txt Drops the note claiming DV failures are handled via error-signature quarantine.
.github/workflows/util/delta-spark-ut/flaky-error-patterns.txt Removes the two quarantined DV error signatures, leaving the file empty of patterns.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread .github/workflows/util/delta-spark-ut/README.md Outdated
Comment thread .github/workflows/util/delta-spark-ut/README.md Outdated
felipepessoto and others added 2 commits August 21, 2026 23:58
The native Delta bitmap aggregator intermittently aborted during a MERGE
writing deletion vectors, with a garbage row index. Because it landed on a
different *DVs*Suite test each run, it was quarantined by error signature
rather than by test name.

The root cause was not in the aggregator. It was a Velox scan defect: with no
child readers, a filter and no deletion, 'outputRows()' was empty while the
result carried numValues rows, so the row-index child came back with zero rows
and downstream reads ran off the end of a zero-length buffer. Fixed upstream in
facebookincubator/velox#18536, so the aggregator now receives real row indexes
and the suite can be enforced again.

Remove both patterns and the two cross-references that named them. The README
keeps the example, marked historical, since it documents the mechanism.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
The example regex allowed an optional minus sign, which contradicted both the
pattern it documents and the line above it saying patterns are deliberately
specific. The file's real pattern was `-\d+`, with a comment explaining that
the check is `value >= 0` so the index is always negative and the sign should
be matched explicitly.

Also name the Velox PR that fixed the root cause and the pin that picked it up,
so the historical note says where the fix landed rather than just that it did.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 21, 2026 23:59
@felipepessoto
felipepessoto force-pushed the remove-dv-flaky-quarantine branch from a9ceba2 to 9fee7d0 Compare August 21, 2026 23:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

Comment thread .github/workflows/util/delta-spark-ut/README.md
Comment thread .github/workflows/util/delta-spark-ut/README.md Outdated
The regex block sits above the paragraph explaining that the patterns are no
longer active, so a reader skimming for config could mistake it for the current
contents of flaky-error-patterns.txt and copy it back in. Mark it inside the
block, where it cannot be missed.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings August 22, 2026 00:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[VL] Native Delta DV bitmap aggregator aborts on a Long.MAX_VALUE sentinel row index during MERGE with deletion vectors (intermittent VeloxRuntimeError)

2 participants